<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/include/taglibs.jsp"%>
<script type="text/javascript">

$(document).ready(function(){

});

//데이터 저장
function submitData(){
	if(confirm("등록하시겠습니까?")){
		$("#frmData").submit();	
	}
	
}

//데이터 삭제  
function deleteData(no){
	if(confirm("삭제하시겠습니까?")){
		location.href="./peti601T.do?p_id=${map.p_id}&sc_no="+no;	
	}
	
}

//기본요금 변경
function setBasePay(sms_pay){
	if(confirm("요금을 변경하시겠습니까?")){
		location.href="./peti602T.do?p_id=${map.p_id}&sms_pay="+$("#sms_pay").val();	
	}
}

//요금 설정 구매
function setMoney(type,val){
	if(type==1){
		$('#sc_pay').val($(val).val()*$('#sms_pay').val());
	}else{
		$('#sc_cnt').val($.frp($(val).val()/$("#sms_pay").val(),0));
	}
}

//수정
function updateData(id){
	if(confirm("수정하시겠습니까?")){
		$("#"+id).submit();	
	}
	
}

//삭제
function deleteData(no){
	if(confirm("삭제하시겠습니까?")){
		location.href="./peti802T.do?p_id=${map.p_id}&sb_no="+no+"&sb_type=${param.sb_type}";	
	}
}

</script>

<%@ include file="/WEB-INF/jsp/pmgr/pe/ti/page_top.jsp"%>



<table width="700">
	<tr>
		<td align="left">
			<c:if test="${param.sb_type=='hot' }">Hot New</c:if>
			<c:if test="${param.sb_type=='brd' }">공지사항</c:if>
		</td>
		<td align="right">&nbsp;</td>
	</tr>
</table>

<form action="./peti800T.do" method="post" name="form1" id="frmData">
<input type="hidden" name="p_id" value="${map.p_id }"> 
<input type="hidden" name="sb_type" value="${param.sb_type }"> 
<!-- <input type="hidden" name="p_id" value="">  -->

<table width="700" border="0" cellspacing="1" cellpadding="2"
	class="class_admin_table">
		<tr>
			<td height="25" class="class_admin_table_head" width="80"
				align="center">메모</td>
			<td height="25" class="class_admin_table_blank">&nbsp;&nbsp; <input
				type="text" name="sb_content" maxlength="100" size="60" value=""></td>
			<td height="25" class="class_admin_table_blank"><input
				type="button" onclick="submitData();" value=" 추 가 ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
		</tr>
</table>
</form>

<br/>
<table width="700" border="0" cellspacing="1" cellpadding="2"
	class="class_admin_table">
	<tr height="25" class="class_admin_table_head">
		<td align="center">메모</td>
		<td align="center" width="150">등록일</td>
		<td align="center" width="50">삭제</td>
	</tr>
<c:if test="${list !=null && fn:length(list)>0 }">
	<c:forEach var="map1" items="${list}" varStatus="status">
	<tr height="25" class="class_admin_table_blank">
		<form id="frmData${status.index }" action="./peti801T.do" method="post">
		<input type="hidden" name="p_id" value="${map1.p_id }"> 
		<input type="hidden" name="sb_type" value="${map1.sb_type }"> 
		<input type="hidden" name="sb_no" value="${map1.sb_no }">
		<td>
			<input name="sb_content" value="${map1.sb_content }" type="text" maxlength="100" size="60" >
		</td>
		<td align="center">${map1.reg_dt_n }</td>
		<td align="center">
			<input type="button" value="수정" onclick="updateData('frmData${status.index }');"/>
			<input type="button" value="삭제" onclick="deleteData('${map1.sb_no }');"/>
		</td>
		</form>
	</tr>
	</c:forEach>
</c:if>
<c:if test="${list ==null || fn:length(list)==0 }">
	<tr height="25" class="class_admin_table_blank">
		<td colspan="3">데이터가 없습니다</td>
	</tr>
</c:if>
</table>
<table width="700" border="0" cellspacing="1" cellpadding="2"
	class="class_admin_table_nocolor">
	<tr>
		<td height="25" align="center">${pageHtml }</td>
	</tr>
</table>

<table width="700" border="0" cellspacing="1" cellpadding="2"
	class="class_admin_table_nocolor">
	<tr>
		<td height="25" align="center"><input type="button"
			onclick="location.href='./peti100Q.do';"
			value=" 펜 션 목 록 "></td>
	</tr>
</table>

